package com.ego.item.service.impl;

import com.ego.item.mapper.SpecificationMapper;
import com.ego.item.pojo.Specification;
import com.ego.item.service.SpecificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Service
public class SpecificationServiceImpl implements SpecificationService {
    @Autowired
    private SpecificationMapper specificationMapper;
    @Transactional
    @Override
    public void save(Specification specification) {
        specificationMapper.insertSelective(specification);
    }

    @Override
    public Specification findByCid(Long cid) {
        return specificationMapper.selectByPrimaryKey(cid);
    }

    @Override
    public void put(Specification specification) {
        specificationMapper.updateByPrimaryKey(specification);
    }
}
